Add 'erase_only' option to dg-100.
authorrobertl <robertl>
Tue, 23 Jun 2009 03:02:20 +0000 (03:02 +0000)
committerrobertl <robertl>
Tue, 23 Jun 2009 03:02:20 +0000 (03:02 +0000)
dg-100.c
xmldoc/formats/dg-100.xml

index 78e50be588d861a3d6c9e90a5d1228914edf8e57..5cc616ce1d42b4d18fcde98cec4a9c6686619873 100644 (file)
--- a/dg-100.c
+++ b/dg-100.c
@@ -619,11 +619,14 @@ dg100_erase()
 /* GPSBabel integration */
 
 static char *erase;
+static char *erase_only;
 
 static
 arglist_t dg100_args[] = {
        { "erase", &erase, "Erase device data after download", 
                "0", ARGTYPE_BOOL, ARG_NOMINMAX }, 
+       { "erase_only", &erase_only, "Only erase device data, do not download anything",
+               "0", ARGTYPE_BOOL, ARG_NOMINMAX }, 
        ARG_TERMINATOR
 };
 
@@ -655,6 +658,10 @@ dg100_rd_deinit(void)
 static void
 dg100_read(void)
 {
+       if (*erase_only == '1') {
+               dg100_erase();
+               return;
+       }
        dg100_getfiles();
        if (*erase == '1') {
                dg100_erase();
index 35b95bb6288d0ba0fdcd45b14e04b6b7da645dee..cc7b6fc7b5b9f148ad7357ded9b04f1c241ce6d7 100644 (file)
@@ -7,6 +7,10 @@
   <title>Command showing DG-100 download and erase on Linux</title>
   <para><userinput>gpsbabel -t -i dg-100,erase -o gpx /dev/ttyUSB0 outputfile.gpx</userinput></para>
 </example>
+<example id="dg-100-on-linux-erase_only">
+  <title>Command showing DG-100 erase_only option on Linux</title>
+  <para><userinput>gpsbabel -t -i dg-100,erase_only /dev/ttyUSB0</userinput></para>
+</example>
 
 <para>
 The DG-100 provides a physical USB interface to the host computer, but